package com.qianji.controller;

import com.qianji.pojo.SalesUrlDto;
import com.qianji.service.SalesUrlService;
import com.qianji.utils.Result;
import com.qianji.vo.Introduction;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 钟丽诗
 * @Date 2021.5.24
 * 第三方链接和我方链接的关联表查询
 */
@Slf4j
@RestController
@RequestMapping("/salesUrl/")
public class SalesUrlController {

    @Autowired
    private SalesUrlService salesUrlService;

    /**
     * 根据主键查询链接数据
     * @param introduction
     * @return
     */
    @ApiOperation("查询链接数据")
    @RequestMapping(value = "findSalesUrl",method = RequestMethod.POST)
    public Result findSalesUrl(@RequestBody Introduction introduction){

        SalesUrlDto salesUrlDto = salesUrlService.findById(introduction.getData().getId());

        return new Result(salesUrlDto);

    }

}
